<template>
	<view class="content">
		<!-- <demoCard :showOptButton="true" :optButtonTitle="buttonTitle" @optButtonClieck="clickComponentA">
			<template v-slot:header>
				<text>头部</text>
			</template>
			<template v-slot:body>
				<text>111</text>
				<text>111</text>
				<text>111</text>
				<text>111</text>
				<text>111</text>
			</template>
		</demoCard> -->
		
		<!-- <myTable :thDataList="thDataList">
			
		</myTable> -->
		<commodityTypeSelect 
		:listData="listData" 
		@itemClick="itemClick" 
		@typeSelectEndClick="typeSelectEndClick"
		@getNextListClick="getNextListClick"
		@goToTypIdClick="goToTypIdClick"
		></commodityTypeSelect>
	</view>
</template>

<script>
	import demoCard from "@/components/my-demos/demo-card.vue";
	import myTable from "@/components/my-table.vue";
	import commodityTypeSelect from "@/components/commodity-type-select.vue";
	
	export default {
		components: {
			demoCard,
			myTable,
			commodityTypeSelect,
		},
		data() {
			return {
				buttonTitle:"操作按钮",
				thDataList:[
					{title:"n1"},
					{title:"n2"},
					{title:"n3"},
				],
				listData:[
					{
						id:"1",
						name:"测试1",
						namePath:"1>2",
						checked:false,
					},
					{
						id:"2",
						name:"测试2",
						namePath:"1>2>3",
						checked:true,
					},
				],
				listData1:[
					{
						id:"3",
						name:"测试2",
						namePath:"1>5",
						checked:false,
					},
					{
						id:"4",
						name:"测试3",
						namePath:"1>4>5",
						checked:true,
					},
				],
			}
		},
		onLoad() {

		},
		onLoad() {
		},
		methods: {
			clickComponentA(){
				console.log("按钮被点击");
			},
			itemClick(value){
				// console.log(value);
			},
			typeSelectEndClick(){
				console.log("ok");
			},
			getNextListClick(typeId){
				this.listData = this.listData1;
				// this.listData = [];
			},
			goToTypIdClick(typeId){
				console.log(typeId);
			},
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		
	}

</style>
